#!/usr/bin/env bash
#
# Copyright © 2014 Jesse 'Jeaye' Wilkerson
# See licensing in LICENSE file, or at:
#   http://www.opensource.org/licenses/MIT
#
# File: do_install
# Author: Jesse 'Jeaye' Wilkerson

# XXX: Do not call this script directly: use `make install`
set -o errexit
set -o nounset

echo "Installing from $tmp_man to $mandir/man3"
mkdir -p $mandir/man3
for file in "$tmp_man"/*.3 ; do
  out=$mandir/man3/${file##*/};
  install -p -m 0644 "$file" "$out";
  gzip -f "$out";
done
echo "Done; it's advised to run 'sudo mandb' (GNU) or 'sudo makewhatis' (BSD) now."
